Skip to content

fix: escape percent signs in argparse help text#76

Merged
nats merged 1 commit intobinarylane:mainfrom
nats:fix/escape-percent-in-help-text
Jan 21, 2026
Merged

fix: escape percent signs in argparse help text#76
nats merged 1 commit intobinarylane:mainfrom
nats:fix/escape-percent-in-help-text

Conversation

@nats
Copy link
Copy Markdown
Contributor

@nats nats commented Jan 13, 2026

Summary

  • Fix argparse formatting error when help text contains literal % characters (e.g., "100%")
  • Override _get_help_string in CommandHelpFormatter to escape % as %% while preserving valid %(...)s format specifiers

Resolves the issue where bl server alert get --help would crash with:

TypeError: %i format: a real number is required, not dict

Help text containing literal % characters (e.g., "100%") caused argparse
formatting errors because % is interpreted as a format specifier.

Override _get_help_string in CommandHelpFormatter to escape % as %%
while preserving valid %(...)s format specifiers like %(choices)s.
@nats nats merged commit 081910e into binarylane:main Jan 21, 2026
18 checks passed
@nats nats deleted the fix/escape-percent-in-help-text branch January 21, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant